package gui.internalFrames;

import controle.gui.ControleFPreferencias;
import gui.FramePrincipal;
import gui.utils.MascarasJTextField;
import gui.utils.MyDesktopPanel;
import gui.utils.TamanhoJTextField;
import java.io.File;
import javax.swing.JFormattedTextField;

/**
 *
 * @author Maycon Fernando Silva Brito
 * @email mayconfsbrito@gmail.com
 */
public class InternalFramePreferencias extends javax.swing.JInternalFrame {

    ControleFPreferencias controle = new ControleFPreferencias(this);

    /**
     * Creates new form InternalFramePreferencias
     */
    public InternalFramePreferencias() {
        initComponents();
        setVisible(true);

        int[] vetor = {60, 60, 20, 45, 45};
        TamanhoJTextField.limitaTamanho(vetor, textNome, textLogradouro, textNumero, textBairro, textCidade);

        //Carrega automaticamente as preferencias salvas em arquivo
        controle.inicializa();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        TabbedPaneOpcoes = new javax.swing.JTabbedPane();
        panelInterface = new javax.swing.JPanel();
        panelLogotipo = new javax.swing.JPanel();
        buttonEscolher = new javax.swing.JButton();
        panelLogo = new MyDesktopPanel(new File("logo.png"));
        panelImagemDesktop = new javax.swing.JPanel();
        comboImagem = new javax.swing.JComboBox();
        panelBancoDeDados = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        comboDuracao = new javax.swing.JComboBox();
        jPanel1 = new javax.swing.JPanel();
        checkBkpAtivacao = new javax.swing.JCheckBox();
        jLabel1 = new javax.swing.JLabel();
        textBkpEnderecoBackup = new javax.swing.JTextField();
        buttonAlterar = new javax.swing.JButton();
        checkBkpAviso = new javax.swing.JCheckBox();
        panelEmpresa = new javax.swing.JPanel();
        panelInformacoes = new javax.swing.JPanel();
        labelNome = new javax.swing.JLabel();
        labelLogradouro = new javax.swing.JLabel();
        labelNumero = new javax.swing.JLabel();
        labelCep = new javax.swing.JLabel();
        labelCidade = new javax.swing.JLabel();
        labelTelefone = new javax.swing.JLabel();
        labelCnpj = new javax.swing.JLabel();
        labelBairro = new javax.swing.JLabel();
        textNome = new javax.swing.JTextField();
        textLogradouro = new javax.swing.JTextField();
        textBairro = new javax.swing.JTextField();
        textCidade = new javax.swing.JTextField();
        textCep = new javax.swing.JFormattedTextField(new MascarasJTextField().inserirMascara("#####-###"))
        ;
        textCnpj = new javax.swing.JTextField();
        textNumero = new javax.swing.JTextField();
        textTelefone = new javax.swing.JTextField();
        panelBotoes = new javax.swing.JPanel();
        buttonOk = new javax.swing.JButton();
        buttonCancelar = new javax.swing.JButton();

        setClosable(true);
        setIconifiable(true);
        setTitle("Preferências");

        TabbedPaneOpcoes.setBackground(new java.awt.Color(204, 204, 204));
        TabbedPaneOpcoes.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        panelLogotipo.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Logotipo", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 0, 0)));

        buttonEscolher.setText("Escolher");
        buttonEscolher.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonEscolherActionPerformed(evt);
            }
        });

        FramePrincipal.carregarLogotipo();
        panelLogo.setBackground(new java.awt.Color(231, 231, 227));
        panelLogo.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        javax.swing.GroupLayout panelLogotipoLayout = new javax.swing.GroupLayout(panelLogotipo);
        panelLogotipo.setLayout(panelLogotipoLayout);
        panelLogotipoLayout.setHorizontalGroup(
            panelLogotipoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelLogotipoLayout.createSequentialGroup()
                .addComponent(buttonEscolher)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelLogo)
                .addGap(150, 150, 150))
        );
        panelLogotipoLayout.setVerticalGroup(
            panelLogotipoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(buttonEscolher)
            .addComponent(panelLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        panelImagemDesktop.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Imagem da Área de Trabalho", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 0, 0)));

        comboImagem.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Gradiente", "Mar Horizonte", "Metal 1", "Metal 2" }));

        javax.swing.GroupLayout panelImagemDesktopLayout = new javax.swing.GroupLayout(panelImagemDesktop);
        panelImagemDesktop.setLayout(panelImagemDesktopLayout);
        panelImagemDesktopLayout.setHorizontalGroup(
            panelImagemDesktopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImagemDesktopLayout.createSequentialGroup()
                .addComponent(comboImagem, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(148, Short.MAX_VALUE))
        );
        panelImagemDesktopLayout.setVerticalGroup(
            panelImagemDesktopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelImagemDesktopLayout.createSequentialGroup()
                .addComponent(comboImagem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 52, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout panelInterfaceLayout = new javax.swing.GroupLayout(panelInterface);
        panelInterface.setLayout(panelInterfaceLayout);
        panelInterfaceLayout.setHorizontalGroup(
            panelInterfaceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelLogotipo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(panelImagemDesktop, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        panelInterfaceLayout.setVerticalGroup(
            panelInterfaceLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelInterfaceLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(panelLogotipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelImagemDesktop, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        TabbedPaneOpcoes.addTab("Interface", panelInterface);

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Tempo de validade dos registros de transações feitas pelos usuários:", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 0, 0)));

        comboDuracao.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Nunca", "15 dias", "30 dias", "60 dias", "120 dias", "365 dias" }));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(comboDuracao, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(176, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(comboDuracao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(15, Short.MAX_VALUE))
        );

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Backup", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        checkBkpAtivacao.setText("Realizar Backup Automático");
        checkBkpAtivacao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                checkBkpAtivacaoActionPerformed(evt);
            }
        });

        jLabel1.setText("Endereço de armazenamento:");

        textBkpEnderecoBackup.setEditable(false);

        buttonAlterar.setText("Alterar");
        buttonAlterar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonAlterarActionPerformed(evt);
            }
        });

        checkBkpAviso.setText("Exibir aviso de backup ao encerrar o programa");
        checkBkpAviso.setEnabled(false);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(textBkpEnderecoBackup)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonAlterar))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(checkBkpAtivacao)
                    .addComponent(checkBkpAviso))
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(checkBkpAtivacao)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(textBkpEnderecoBackup, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonAlterar))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(checkBkpAviso)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout panelBancoDeDadosLayout = new javax.swing.GroupLayout(panelBancoDeDados);
        panelBancoDeDados.setLayout(panelBancoDeDadosLayout);
        panelBancoDeDadosLayout.setHorizontalGroup(
            panelBancoDeDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        panelBancoDeDadosLayout.setVerticalGroup(
            panelBancoDeDadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBancoDeDadosLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(46, Short.MAX_VALUE))
        );

        TabbedPaneOpcoes.addTab("Banco De Dados", panelBancoDeDados);

        panelInformacoes.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Informações da Empresa", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));

        labelNome.setText("Nome:");

        labelLogradouro.setText("Logradouro:");

        labelNumero.setText("Nº:");

        labelCep.setText("CEP:");

        labelCidade.setText("Cidade:");

        labelTelefone.setText("Telefone:");

        labelCnpj.setText("CNPJ:");

        labelBairro.setText("Bairro:");

        ((JFormattedTextField)textCep).setFocusLostBehavior(JFormattedTextField.COMMIT);
        ((JFormattedTextField)textCep).setHorizontalAlignment(textCep.LEFT);

        textCnpj = new javax.swing.JFormattedTextField(new MascarasJTextField().inserirMascara("##.###.###/####-##"));
        ((JFormattedTextField)textCnpj).setFocusLostBehavior(JFormattedTextField.COMMIT);

        textTelefone = new javax.swing.JFormattedTextField(new MascarasJTextField().inserirMascara("(##)####-####"));
        ((JFormattedTextField)textTelefone).setFocusLostBehavior(JFormattedTextField.COMMIT);

        javax.swing.GroupLayout panelInformacoesLayout = new javax.swing.GroupLayout(panelInformacoes);
        panelInformacoes.setLayout(panelInformacoesLayout);
        panelInformacoesLayout.setHorizontalGroup(
            panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelInformacoesLayout.createSequentialGroup()
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(labelNome)
                    .addComponent(labelLogradouro)
                    .addComponent(labelBairro)
                    .addComponent(labelCep)
                    .addComponent(labelCidade)
                    .addComponent(labelTelefone)
                    .addComponent(labelNumero)
                    .addComponent(labelCnpj))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(textTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textCep, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textNumero, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textNome, javax.swing.GroupLayout.DEFAULT_SIZE, 340, Short.MAX_VALUE)
                    .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(textCnpj, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(textLogradouro, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(textCidade, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE)
                        .addComponent(textBairro, javax.swing.GroupLayout.Alignment.LEADING)))
                .addContainerGap())
        );
        panelInformacoesLayout.setVerticalGroup(
            panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelInformacoesLayout.createSequentialGroup()
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelNome)
                    .addComponent(textNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelLogradouro)
                    .addComponent(textLogradouro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5)
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelNumero)
                    .addComponent(textNumero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelBairro))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelCep)
                    .addComponent(textCep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelCidade))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelTelefone)
                    .addComponent(textTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelInformacoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelCnpj)
                    .addComponent(textCnpj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout panelEmpresaLayout = new javax.swing.GroupLayout(panelEmpresa);
        panelEmpresa.setLayout(panelEmpresaLayout);
        panelEmpresaLayout.setHorizontalGroup(
            panelEmpresaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelInformacoes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        panelEmpresaLayout.setVerticalGroup(
            panelEmpresaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelInformacoes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        TabbedPaneOpcoes.addTab("Dados da Empresa", panelEmpresa);

        panelBotoes.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        buttonOk.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Confirma.png"))); // NOI18N
        buttonOk.setText("Ok");
        buttonOk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonOkActionPerformed(evt);
            }
        });

        buttonCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/buttons/Cancelar.png"))); // NOI18N
        buttonCancelar.setText("Cancelar");
        buttonCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonCancelarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelBotoesLayout = new javax.swing.GroupLayout(panelBotoes);
        panelBotoes.setLayout(panelBotoesLayout);
        panelBotoesLayout.setHorizontalGroup(
            panelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBotoesLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(buttonOk)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonCancelar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        panelBotoesLayout.setVerticalGroup(
            panelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelBotoesLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelBotoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(buttonOk)
                    .addComponent(buttonCancelar))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelBotoes, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(TabbedPaneOpcoes)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(TabbedPaneOpcoes, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelBotoes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void buttonEscolherActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonEscolherActionPerformed
        controle.copiarLogotipo(this.panelLogo, this);
    }//GEN-LAST:event_buttonEscolherActionPerformed

    private void buttonCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCancelarActionPerformed
        this.dispose();
    }//GEN-LAST:event_buttonCancelarActionPerformed

    private void buttonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOkActionPerformed
        controle.salvaPreferencias(this);
        
    }//GEN-LAST:event_buttonOkActionPerformed

    private void buttonAlterarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAlterarActionPerformed
        controle.eventoLocalizarArquivoBackup(textBkpEnderecoBackup);
    }//GEN-LAST:event_buttonAlterarActionPerformed

    private void checkBkpAtivacaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkBkpAtivacaoActionPerformed
        controle.guiBkpAtiva(checkBkpAtivacao);
    }//GEN-LAST:event_checkBkpAtivacaoActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JTabbedPane TabbedPaneOpcoes;
    public javax.swing.JButton buttonAlterar;
    public javax.swing.JButton buttonCancelar;
    public javax.swing.JButton buttonEscolher;
    public javax.swing.JButton buttonOk;
    public javax.swing.JCheckBox checkBkpAtivacao;
    public javax.swing.JCheckBox checkBkpAviso;
    public javax.swing.JComboBox comboDuracao;
    public javax.swing.JComboBox comboImagem;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel labelBairro;
    private javax.swing.JLabel labelCep;
    private javax.swing.JLabel labelCidade;
    private javax.swing.JLabel labelCnpj;
    private javax.swing.JLabel labelLogradouro;
    private javax.swing.JLabel labelNome;
    private javax.swing.JLabel labelNumero;
    private javax.swing.JLabel labelTelefone;
    private javax.swing.JPanel panelBancoDeDados;
    private javax.swing.JPanel panelBotoes;
    private javax.swing.JPanel panelEmpresa;
    private javax.swing.JPanel panelImagemDesktop;
    private javax.swing.JPanel panelInformacoes;
    private javax.swing.JPanel panelInterface;
    public MyDesktopPanel panelLogo;
    private javax.swing.JPanel panelLogotipo;
    public javax.swing.JTextField textBairro;
    public javax.swing.JTextField textBkpEnderecoBackup;
    public javax.swing.JTextField textCep;
    public javax.swing.JTextField textCidade;
    public javax.swing.JTextField textCnpj;
    public javax.swing.JTextField textLogradouro;
    public javax.swing.JTextField textNome;
    public javax.swing.JTextField textNumero;
    public javax.swing.JTextField textTelefone;
    // End of variables declaration//GEN-END:variables
}
